import {ObjectDto, ObjectDtoInterface} from "../../services/sqliteDB/object.dto";
import { TableColumnType } from "../../services/sqliteDB/object.dto";
import {SyncStatus} from "../sync-status";

export class BillDto extends ObjectDto implements ObjectDtoInterface {
    public id: string = null;
    public userId: string = null; // 用户id
    public billDate: number = null; // 时间戳格式
    public year: number = null; // 年份
    public month: number = null; // 月份
    public customerNo: string = null; // 客户号
    public account: string = null; // 客户账户

    public chargeDetailId: string = null; // 催费名单ID和账单id区别？ ------根据欠费记录来的，有欠费就会有chargeDetailId
    public chargeLevel: number = null; // 催费级别
    public chargeStatus: number = null; // 催费状态-----？催费状态，0 非催费 1 处于催费
    public chargeTimesOne: number = null; // 一级催费次数
    public chargeTimesTwo: number = null;	// 二级催费次数
    public chargeTimesThree: number = null;	// 三级催费次数
    public arrearsElectricity: number = null;
    public arrearsBasicFee: number = null;
    public totalFee: number = null;
    public arrearsAdjustFee: number = null;
    public penalty: number = null; // 应收违约金

    public payHistoryId: string = null; // 支付历史Id
    public payMonth: number = null; // 支付月份
    public payDate: number = null; // 支付时间
    public businessType: number = null; // 支付类型
    public businessMethod: string = null; // 支付方式
    public powerUnit: number = null; // 电费
    public actualFee: number = null; // 实收
    public actualPenalty: number = null; // 实收违约金
    public actualTotal: number = null; // 实收总额
    public feeType: string = null;

    public noticeID: string = null; // 通知单Id
    public noticeUploadTime: number = null;			// 通知单张贴时间
    public noticeUploaderName: string = null; // 上传人名字
    public noticeUploaderAccount: string = null; // 上传人账号
    public attachmentIds: string = null;		// 通知单图片IDs, 逗号分隔。
    public thumbnailIds: string = null;		// 通知单图片缩略图ID, 逗号分隔。
    public electricityMeterIds: string = null;
    public syncStatus: SyncStatus = null;
    public isSettle: number = SyncStatus.None; // 有无结清

  constructor() {
        super();

    }

    table() {
        return {
            tableName: "Bills",
            tableConstructor: {
                id: `${TableColumnType.text} ${TableColumnType.unique}`,
                userId: `${TableColumnType.text}`,
                billDate: TableColumnType.int,
                year: TableColumnType.int,
                month: TableColumnType.int,
                customerNo: TableColumnType.text,
                account: TableColumnType.text,

                chargeDetailId: TableColumnType.text,
                chargeLevel: TableColumnType.int,
                chargeStatus: TableColumnType.int,
                chargeTimesOne: TableColumnType.int,
                chargeTimesTwo: TableColumnType.int,
                chargeTimesThree: TableColumnType.int,
                arrearsElectricity: TableColumnType.int,
                arrearsBasicFee: TableColumnType.int,
                totalFee: TableColumnType.int,
                arrearsAdjustFee: TableColumnType.int,

                payHistoryId: TableColumnType.text,
                payMonth: TableColumnType.int,
                payDate: TableColumnType.int,
                businessType: TableColumnType.text,
                businessMethod: TableColumnType.text,
                powerUnit: TableColumnType.int,
                actualFee: TableColumnType.int,
                penalty: TableColumnType.int,
                actualPenalty: TableColumnType.int,
                actualTotal: TableColumnType.int,
                feeType: TableColumnType.text,

                noticeID: TableColumnType.text,
                noticeUploadTime: TableColumnType.int,
                noticeUploaderName: TableColumnType.text,
                noticeUploaderAccount: TableColumnType.text,
                attachmentIds: TableColumnType.text,
                thumbnailIds: TableColumnType.text,
                electricityMeter: TableColumnType.text,
                syncStatus: TableColumnType.int,
                isSettle: TableColumnType.int
            }
        };
    }
}
